Skip to content

Update tenet-pr-review.yml#111

Open
S3DFX-CYBER wants to merge 6 commits into
mainfrom
S3DFX-CYBER-patch-6
Open

Update tenet-pr-review.yml#111
S3DFX-CYBER wants to merge 6 commits into
mainfrom
S3DFX-CYBER-patch-6

Conversation

@S3DFX-CYBER

@S3DFX-CYBER S3DFX-CYBER commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary by cubic

Hardens the TENET PR review workflow for fork safety and secret hygiene. Switches to pull_request_target, avoids checking out fork refs, reads diffs via HEAD_SHA, gates on TENET_AI_KEY, and skips bot PRs.

  • Refactors

    • Use pull_request_target; do not checkout fork refs; read diffs via HEAD_SHA; set persist-credentials: false.
    • Gate the review step on TENET_AI_KEY via a step output; skip github-actions[bot] and coderabbitai[bot].
    • Install and cache from agent/tenet_agent; run the agent from .github/tenet_agent.
  • Dependencies

    • Pin actions/checkout and actions/setup-python to exact SHAs for stability.

Written for commit 6a85340. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Pinned workflow action versions for greater stability and reliability.
    • Skipped automated bot-created PR runs to reduce unnecessary reviews.
    • Adjusted agent dependency caching and installation to a new location for more reliable builds.
    • Reworked API key handling to expose a boolean check and gate the review step accordingly.

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tenet-ai.org Ready Ready Preview, Comment Jun 13, 2026 8:51am

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The TENET PR review workflow is restructured: the trigger changes to pull_request_target with bot-user filtering, agent files relocate from .github/tenet_agent to agent/tenet_agent, action versions are pinned, and the TENET API key check is refactored to use conditional step execution via an output flag.

Changes

TENET Security Review Workflow Update

Layer / File(s) Summary
Migrate TENET agent paths and update workflow trigger
.github/workflows/tenet-pr-review.yml
Workflow trigger switches to pull_request_target with job-level bot-user filtering. Action versions are pinned; actions/checkout uses persist-credentials: false. TENET agent paths and dependency/cache/install references move from .github/tenet_agent to agent/tenet_agent. The TENET AI key check now emits has_key and the review step runs only when steps.key_check.outputs.has_key == 'true'. The script's working directory is updated to agent/tenet_agent.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TENET-DEV-AI/TENET-AI#45: Directly updates the same TENET PR review workflow file, changing its trigger conditions, path references, and step orchestration.

Suggested labels

🚨 security

Poem

🐰 The workflow hops from old to new,
Bot guards now filter what to do,
Paths migrate east to agent/tenet_agent bright,
API keys gate each PR review night,
Security tightens—tests take flight! 🔐

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive phrasing that does not convey meaningful information about the specific changes made. Consider a more specific title that highlights the main change, such as 'Harden TENET PR review workflow for fork safety' or 'Switch PR review to pull_request_target with security hardening'.
Description check ❓ Inconclusive The PR description is auto-generated and provides a clear summary of changes, but does not follow the repository's description template structure with required sections like Type of Change, Testing, and Checklist. While the auto-generated summary is informative, consider whether the template should be followed or whether auto-generated summaries are accepted as exceptions in this repository's workflow.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch S3DFX-CYBER-patch-6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98b9a9667a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/tenet-pr-review.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/tenet-pr-review.yml:
- Around line 24-27: The Checkout repository step using
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd should explicitly set
persist-credentials: false to avoid persisting git credentials; update the
checkout step's with block to include persist-credentials: false (refer to the
"Checkout repository" step and the uses: actions/checkout entry) so credentials
are not stored and cannot be leaked when running under pull_request_target.
- Line 34: The workflow uses a non-existent path
`agent/tenet_agent/requirements.txt` for cache-dependency-path and pip install
but later cd's into `.github/tenet_agent`; fix by making the dependency/cache
paths consistent with the actual directory: replace occurrences of
`agent/tenet_agent/requirements.txt` and any `pip install -r
agent/tenet_agent/requirements.txt` with `.github/tenet_agent/requirements.txt`
(or vice versa if you prefer moving the dir), ensuring `cache-dependency-path`,
the `pip install -r ...` invocation, and the `cd .github/tenet_agent` reference
all point to the same directory name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f6b84624-b7c6-4d8b-ba49-4fd19693a55e

📥 Commits

Reviewing files that changed from the base of the PR and between 3803ad0 and 98b9a96.

📒 Files selected for processing (1)
  • .github/workflows/tenet-pr-review.yml

Comment thread .github/workflows/tenet-pr-review.yml
Comment thread .github/workflows/tenet-pr-review.yml

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/tenet-pr-review.yml">

<violation number="1" location=".github/workflows/tenet-pr-review.yml:63">
P1: This path change is inconsistent with earlier workflow steps, which still use `agent/tenet_agent`; the review job will fail before execution due to invalid dependency paths.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

@@ -57,4 +61,4 @@ jobs:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
cd .github/tenet_agent

@cubic-dev-ai cubic-dev-ai Bot Jun 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: This path change is inconsistent with earlier workflow steps, which still use agent/tenet_agent; the review job will fail before execution due to invalid dependency paths.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/tenet-pr-review.yml, line 63:

<comment>This path change is inconsistent with earlier workflow steps, which still use `agent/tenet_agent`; the review job will fail before execution due to invalid dependency paths.</comment>

<file context>
@@ -60,5 +60,5 @@ jobs:
           HEAD_SHA: ${{ github.event.pull_request.head.sha }}
         run: |
-          cd agent/tenet_agent
+          cd .github/tenet_agent
           python tenet_review.py
\ No newline at end of file
</file context>
Fix with cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/tenet-pr-review.yml">

<violation number="1" location=".github/workflows/tenet-pr-review.yml:63">
P1: This path change is inconsistent with earlier workflow steps, which still use `agent/tenet_agent`; the review job will fail before execution due to invalid dependency paths.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread .github/workflows/tenet-pr-review.yml
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@S3DFX-CYBER

Copy link
Copy Markdown
Collaborator Author

@coderabbitai re review and provide analysis

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch PR diff
gh pr view 111 --repo TENET-DEV-AI/TENET-AI --json title,body,files,additions,deletions

# Get the workflow file content on the PR branch
gh api repos/TENET-DEV-AI/TENET-AI/contents/.github/workflows/tenet-pr-review.yml \
  --jq '.content' | base64 -d

echo "---DIFF---"
gh pr diff 111 --repo TENET-DEV-AI/TENET-AI

Length of output: 7103



@S3DFX-CYBER Here is the detailed re-review and analysis of PR #111:


🔍 Analysis: tenet-pr-review.yml

🚨 Critical Bug — Path Inconsistency

The install and cache paths were updated to agent/tenet_agent, but the execution step was not updated:

# Updated ✅
- cache-dependency-path: .github/tenet_agent/requirements.txt
+ cache-dependency-path: agent/tenet_agent/requirements.txt

- run: pip install -r .github/tenet_agent/requirements.txt
+ run: pip install -r agent/tenet_agent/requirements.txt

# NOT updated ❌ — still points to old path
  run: |
    cd .github/tenet_agent     ← BUG: should be agent/tenet_agent
    python tenet_review.py

This will cause the workflow to fail at runtime because cd .github/tenet_agent will not find tenet_review.py if the agent has been moved to agent/tenet_agent. It should be:

run: |
  cd agent/tenet_agent
  python tenet_review.py

⚠️ High — pull_request_target Security Posture

Switching to pull_request_target is a high-risk change. It runs in the context of the base repository with access to secrets, even when triggered from a fork. The inline comment correctly states the mitigation:

Do NOT add ref: github.event.pull_request.head.sha

This is the right approach — the checkout will pull the base branch (not the fork's code), and the TENET agent reads the diff via the GitHub API using HEAD_SHA. This pattern is safe only as long as no future maintainer adds ref: ${{ github.event.pull_request.head.sha }} to the checkout step. Recommend documenting this explicitly in the repo's security policy or CODEOWNERS for this file.


✅ Good Changes

Change Assessment
Pinned action SHAs (checkout@de0fac2e..., setup-python@a309ff8b...) ✅ Excellent supply-chain hygiene
persist-credentials: false ✅ Reduces secret exposure in pull_request_target context
Bot filter: github.event.pull_request.user.login instead of github.actor ✅ More accurate for pull_request_target where actor could be the workflow runner
API key check via GITHUB_OUTPUT + if: conditional ✅ Cleaner than exit 0; prevents false-positive job failures

🔵 Minor

  • Missing newline at end of file — the diff shows \ No newline at end of file on the last line. This is a cosmetic issue but violates POSIX file standards and may trigger linters.

Summary

Severity Issue
🚨 Critical cd .github/tenet_agent not updated to cd agent/tenet_agentworkflow will fail
⚠️ High pull_request_target requires strict access control on this workflow file (e.g., CODEOWNERS)
🔵 Minor Missing newline at end of file

The critical path bug must be fixed before merging — it will cause every triggered run to fail at the Run TENET PR Review step. Everything else in the PR is solid security-hardening work.

✅ Action performed

Full review finished.

@S3DFX-CYBER

Copy link
Copy Markdown
Collaborator Author

@coderabbitai update the whole workflow file and provide me the updated patched file which will work for contributors and maintainers prs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant